Decoding device, image transmission system, and decoding method

ABSTRACT

A decoding device according to an embodiment includes: a reception memory for storing received image; a frame buffer for storing a reference image; a decoding unit for decoding the received image based on the reference image stored in the frame buffer; a reference image storage for storing the decoded image, decoded by the decoding unit, in the frame buffer as the reference image; and an output image selection unit for selecting the reference image stored in the frame buffer as an output image when the reception memory underflows and selecting the decoded image as the output image when the reception memory does not underflow.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority fromthe prior Japanese Patent Application No. 2015-178101 filed on Sep. 10,2015; the entire contents of which are incorporated herein by reference.

FIELD

Embodiments described herein relate generally to a decoding device, animage transmission system, and a decoding method.

BACKGROUND

An image is compressed and then transmitted. Therefore, a receivingdevice includes a decoding unit for decoding reception data. Generally,a receiving device includes a buffer for retaining reception data, adecoded image, or a reference image in a preceding stage or subsequentstage to the decoding unit or therewithin. The decoding unit isgenerally provided with a large-capacity buffer in case where image datacannot be received.

It is important that mobile terminals implement low power consumption.However, large-capacity buffers consume a large volume of power and itresults in large power consumption of the device. Moreover,large-capacity buffers result in high product cost. To implement lowpower consumption and low cost, buffers are required to have a smallercapacity.

In addition, it is important that game terminals implement low delay.However, in a device requiring a large-capacity buffer, a delay in imageoutput is large since a certain volume of image data is retained in thebuffer and then decoding or outputting of the image starts. To implementlow delay in image transmission, buffers are required to have a smallercapacity.

However, a small-capacity buffer is prone to artifacts of output imageswhen a transmission path of the image becomes unstable.

DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an image transmission system according toan embodiment;

FIG. 2 is a block diagram of a compression unit provided to an encodingdevice;

FIG. 3 is a block diagram of an expansion unit provided to a decodingdevice;

FIG. 4 is a flowchart of image compression processing;

FIG. 5 is a diagram for describing operation of the compression unit;

FIG. 6 is a flowchart of image expansion processing;

FIG. 7 is a diagram illustrating a decoded image divided by a referenceimage storage;

FIG. 8 is an example of reading and writing by a frame buffer when areception memory does not underflow;

FIG. 9 is an example of reading and writing by the frame buffer when thereception memory does not underflow;

FIG. 10 is a state transition diagram of the reference image storage anda reference image expansion unit;

FIG. 11 is a diagram illustrating a status of the frame buffer afteroccurrence of underflow;

FIG. 12 is a diagram illustrating an exemplary output image;

FIG. 13 is a block diagram of a reference image expansion unit accordingto a second embodiment;

FIG. 14 is a block diagram of an expansion unit according to a thirdembodiment; and

FIG. 15 is a block diagram of an expansion unit according to a fourthembodiment.

DETAILED DESCRIPTION

A decoding device according to an embodiment includes: a receptionmemory for storing image received; a frame buffer for storing areference image; a decoding unit for decoding the image based on thereference image and generating a decoded image; a reference imagestorage for storing the decoded image in the frame buffer as thereference image; and an output image selection unit for selecting thereference image stored in the frame buffer when the reception memoryunderflows and selecting the decoded image when the reception memorydoes not underflow.

Embodiments will be described below with reference to the drawings. Notethat a same reference sign is used for a same or an equivalent part inthe drawings.

First Embodiment

FIG. 1 is a block diagram of an image transmission system according tothe present embodiment. The image transmission system 1 includes anencoding device 100 for compressing image and a decoding device 200 forexpanding the image received from the encoding device 100. The encodingdevice 100 is connected to the decoding device 200 via a transmissionpath. The transmission path may be a communication cable such as ahigh-definition multimedia interface (HDMI (registered trademark)) cableor a network such as a local area network (LAN) or the Internet.Moreover, the transmission path may be wireless such as a wireless LAN.The encoding device 100 transmits an image stream to the decoding device200 via the transmission path.

First, a configuration of the encoding device 100 will be described. Theencoding device 100 includes a control unit 110, an input unit 120, atransmission unit 130, and a compression unit 140.

The control unit 110 is a processing device, such as a processor, forcontrolling the respective units of the encoding device 100.

The input unit 120 is an input interface for acquiring an image signalfrom an external device (e.g. camera). The image signal is stream data,such as an output signal of broadcasting data or camera, which flowswithout interruption. The input unit 120 generates image data throughA/D conversion of the image signal and transmits the image data to thecompression unit 140. The image data includes a plurality ofuncompressed frames (hereinafter referred to as “input frame”).

The compression unit 140 is a processing device that compresses theimage data. The compression unit 140 compresses the input frame andtransmits the input frame to the transmission unit 130.

The transmission unit 130 is an output interface for transmitting datato the decoding device 200. The transmission unit 130 multiplexes thecompressed image data (e.g. a prediction error data, motion vector, andcompressed frame). The transmission unit 130 notifies to the compressionunit 140 that data transmission to the decoding device 200 has beenhalted due to a factor such as an external disturbance.

FIG. 2 is a block diagram of the compression unit 140. The compressionunit 140 includes an encoding unit 141, a local decoding unit 142, areference image storage 143 (a second reference image storage), a framebuffer 144 (a second frame buffer), and a reference image expansion unit145 (a second reference image expansion unit).

The encoding unit 141 compresses the input frame based on in-frameprediction and inter frame prediction (e.g. based on a moving pictureexperts group (MPEG) method).

The local decoding unit 142 generates a local decoded image based on anoutput from the encoding unit 141. The local decoded image is asimulative reproduction, on the encoding side, of a decoded image to begenerated on the decoding side.

The reference image storage 143 compresses the local decoded image andstores it in the frame buffer 144. As a compression method, variousknown methods may be used. This allows for reducing a storage capacityof the frame buffer 144.

The frame buffer 144 includes a readable and writable storage devicesuch as a static random access memory (SRAM). The frame buffer 144stores the compressed local decoded image (hereinafter referred to as“compressed reference image”). Note that the frame buffer 144 may beprovided outside the compression unit 140.

The reference image expansion unit 145 expands the compressed referenceimage and transmits the compressed reference image to the encoding unit141. The expanded image is used as a reference image (second referenceimage) in the interframe prediction.

Next, a configuration of the decoding device 200 illustrated in FIG. 1will be described. The decoding device 200 includes a control unit 210,a reception unit 220, a reception memory 230, an output unit 240, and anexpansion unit 250.

The control unit 210 includes a processing device such as a processorand controls the respective units of the decoding device 200.

The reception unit 220 is a communication interface for receiving thecompressed image data (hereinafter referred to as “received frame”) fromthe encoding device 100.

The reception memory 230 includes a readable and writable storage devicesuch as an SRAM. The reception memory 230 stores the received frame.Note that, since the reception memory 230 stores the compressed imagedata, a large-capacity buffer is not required.

The expansion unit 250 is a processing device that expands thecompressed video data.

The output unit 240 is an output interface for outputting imageinformation to an output device (e.g. liquid crystal display). Theoutput unit 240 outputs a decoded image decoded by the expansion unit250 to the output device as an output image.

FIG. 3 is a block diagram of the expansion unit 250. The expansion unit250 includes a decoding unit 251, a reference image storage 252 (a firstreference image storage), a frame buffer 253 (a first frame buffer), areference image expansion unit 254 (a first reference image expansionunit), and an output image selection unit 255.

The decoding unit 251 outputs a decoded image decoded from the receivedframe stored in the reception memory 230 to the reference image storage252 and the output image selection unit 255. The decoding unit 251expands the received frame using an expansion method corresponding tothe compression method used by the encoding unit 141.

The reference image storage 252 compresses the decoded image and storesthe decoded image in the frame buffer 253. The reference image storage252 compresses the decoded image using a compression method same as thecompression method used by the reference image storage 143. This allowsa reference image of the decoding device 200 and that of the encodingdevice 100 to match with each other even if irreversible compression isused by the reference image storage 143 and reference image storage 252.Note that, in the following description, the decoded image compressed bythe reference image storage 252 is referred to as a compressed referenceimage similarly to the compressed local decoded image.

The frame buffer 253 includes a readable and writable storage devicesuch as an SRAM and stores the compressed reference image. The framebuffer 253 is a ring buffer and thus, when the frame buffer 253 is usedby one loop, the compressed reference image is saved by overwriting froma head of the frame buffer 253. A capacity of the frame buffer 253 issmaller than a capacity for two frames of the compressed referenceimage. An exemplary capacity of the frame buffer 253 is 500 K bytes.This frame capacity can be changed as appropriate according to an imageresolution or the like. The frame buffer 253 may be provided outside thecompression unit 140.

The reference image expansion unit 254 expands the compressed referenceimage. The reference image expansion unit 254 expands an image by anexpansion method corresponding to the compression method used by thereference image storage 252. The expanded image forms the referenceimage (first reference image). The reference image expansion unit 145outputs the expanded reference image to the decoding unit 251 and theoutput image selection unit 255.

The output image selection unit 255 selects either the reference imageor the decoded image. The output image selection unit 255 selects thedecoded image when the reception memory 230 does not underflow. Theoutput image selection unit 255 selects the reference image when thereception memory 230 underflows. Underflow refers to, for example, astate where there is no subsequent received frame (or a block) to bedecoded in the reception memory 230 or a state where an amount of thereceived frames (or blocks) is less than or equal to a certain amount.The output image selection unit 255 generates an output image based onthe selected reference image and decoded image. When the output image ofone frame has been generated, the output image is transmitted to theoutput unit 240.

Next, operation of the image transmission system 1 will be described.Operation of the image transmission system 1 can be divided into “imagecompression processing” executed by the encoding device 100 and “imageexpansion processing” executed by the decoding device 200.

The image compression processing will be described. FIG. 4 is aflowchart of the image compression processing.

The compression unit 140 determines whether the transmission unit 130has halted transmission (S101). If transmission has not been halted (Noin S101), the compression unit 140 proceeds to S105. If transmission hasbeen halted (Yes in S101), the compression unit 140 halts operation ofthe encoding unit 141 (S102).

Next, the compression unit 140 determines whether the transmission unit130 has restarted transmission (S103). If transmission has not beenrestarted (No in S103), the compression unit 140 repeats S103 untiltransmission is restarted. If transmission has been restarted (Yes inS103), the compression unit 140 restarts operation of the encoding unit141 (S104).

When transmission is restarted, the encoding unit 141 compresses theinput frame (S105). In the present embodiment, the encoding unit 141generates a P frame and I frame. A P frame (predicted frame) is a frameencoded by forward prediction while an I frame (intra-coded frame) is aframe encoded without using interframe prediction. The I frame may beinserted between the P frames at a certain interval (e.g. every fewseconds) or be transmitted only once at a first time after transmissionof the image has been started.

When the P frame is generated, the encoding unit 141 refers to the inputframe preceding by one as the reference image. FIG. 5 is a diagram fordescribing the reference image of the P frame. When a frame F1 isencoded, the compression unit 140 refers to a frame F0 as the referenceimage as denoted with A.

Note that, when the transmission unit 130 restarts transmission of theimage data, the encoding unit 141 restarts encoding not from asubsequent frame to the frame where transmission has been halted butfrom the present input frame. For example, if transmission of the imagedata has been halted for a period from a frame F3 to a frame F5 asillustrated in FIG. 5, the encoding unit 141 restarts encoding not fromthe frame F3 but from a frame F6. Here, the encoding unit 141 refers notto a preceding input frame but to the latest frame compressed beforerestart of transmission as the reference image. In the example of FIG.5, when the frame F6 is encoded, the encoding unit 141 refers not to theframe F5 but to a frame F2 as the reference image. This allows thedecoding device 200 to restart decoding instantly without having to waitfor reception of the I frame even if transmission of the image data isinterrupted.

Thereafter, the local decoding unit 142 generates a local decoded imageby decoding the image encoded by the encoding unit 141 (S106). The localdecoding unit 142 decodes the image by the same decoding method as thatof the decoding unit 251 of the decoding device 200. This allows thereference image of the encoding device 100 and that of the decodingdevice 200 to be exactly the same. Therefore, no errors accumulate dueto continued decoding.

Next, the reference image storage 143 generates a compressed referenceimage by compressing the local decoded image (S107). The reference imagestorage 143 stores the compressed reference image in the frame buffer144. When storing is completed, the compression unit 140 returns toS101. The compression unit 140 repeats S101 to S107 until the controlunit 110 commands to halt the image compression processing.

Next, the image expansion processing will be described. FIG. 6 is aflowchart of the image expansion processing.

The expansion unit 250 determines whether the reception memory 230underflows (S201). The method of determining underflow is not limited toa specific one. For example, the expansion unit 250 may determineoccurrence of underflow when the reception memory 230 does not send datato be decoded next or when an amount of data stored in the receptionmemory 230 is less than or equal to a certain amount. When the receptionmemory 230 underflows (Yes in S201), the expansion unit 250 haltsoperation of the decoding unit 251 and proceeds to S204. When thereception memory does not underflow (No in S201), the expansion unit 250proceeds to S202.

The decoding unit 251 decodes the received frame and generates thedecoded image (S202). Note that, when interframe prediction is used, thedecoding unit 251 refers to the received frame preceding by one as thereference image. If transmission of the image data is interrupted, thedecoding unit 251 refers to the latest frame received before restart oftransmission of the image data as the reference image. The decoding unit251 transmits the decoded image to the output image selection unit 255and the reference image storage 252.

The reference image storage 252 generates a compressed reference imageby compressing the decoded image (S203). In the present embodiment, thedecoded image is divided into a plurality of blocks and therebycompressing the decoded image by each block. FIG. 7 is a diagramillustrating an example of a divided decoded image Fn. In thedescription below, it is assumed that the decoded image is divided intofour equal parts in a horizontal direction. The divided blocks arereferred to as processing blocks B0 to B3. The processing block may bedifferent from a block as a unit of encoding by the encoding unit 141.The reference image storage 252 stores the compressed processing block(hereinafter referred to as “compressed block”) in the frame buffer 253.

The reference image expansion unit 254 reads the compressed block fromthe frame buffer 253. Thereafter, the reference image expansion unit 254expands the compressed block and outputs the block to the decoding unit251 and the output image selection unit 255 as the reference image(S204).

The output image selection unit 255 generates an output image based onthe decoded image or reference image (S205). For example, the outputimage selection unit 255 generates the output image based on the decodedimage when underflow does not occur and generates the output image basedon the reference image when underflow occurs.

Operations of S203 to S205 will be described specifically below. FIG. 8is an example of reading and writing of the frame buffer 253. In FIG. 8,WP denotes a write pointer and RP denotes a read pointer. FnBi (where nand i are integers) denotes a compressed block Bi in a frame Fn(hereinafter referred to as “compressed block FnBi”). Before operationof the compression unit 140 is initiated, a write pointer WP and a readpointer RP are both initialized to zero.

The reference image storage 252 writes the compressed block sequentiallyto the frame buffer 253 from a position indicated by the write pointerWP. S0 in FIG. 8 illustrates a state where a compressed block F0B0 isbeing written. S1 illustrates a state where a compressed block F0B1 isbeing written. Similarly, S2 and S3 illustrate the states wherecompressed blocks F0B2 and F0B3, respectively, are being written.

Note that the size of the compressed block may not be constant. As morevalue on image quality is placed, the size of the compressed block mayinclude a variation width of a certain degree. In this case, thereference image storage 252 stores a write starting position and a sizeof the block in a RAM (not shown) each time writing of each compressedblock is completed. The RAM may be a flip-flop or may be an SRAM.Alternatively, the reference image storage 252 may store the writestarting position and the size of the block in the frame buffer 253. Inthe example of FIG. 8, a write starting position of a compressed blockBi is denoted as BP[i].

The reference image expansion unit 254 reads the compressed blocksequentially from a position indicated by the read pointer RP. S3 inFIG. 8 illustrates a state where the block B0 in the frame F0 is beingread.

FIG. 9 illustrates that a compressed block of the frame F1 is written tothe frame buffer 253 subsequently to the frame F0. The frame buffer 253has a capacity for compressed blocks of one frame and one block. Theframe buffer 253 shall be able to maintain compressed blocks of oneframe at all times.

FIG. 10 is a state transition diagram of the reference image storage 252and reference image expansion unit 254. The reference image storage 252and reference image expansion unit 254 transit among S0 to S3 while thereception memory 230 does not underflow. On the other hand, thereference image storage 252 and reference image expansion unit 254transit from a state S to state E, where E0 to E3 are repeated, when thereception memory 230 underflows. Note that FIG. 10 illustrates a stateof transition to E2 when underflow has occurred in S2.

In the state S, the reference image expansion unit 254 reads thecompressed block from the frame buffer 253 such that the read pointer RPdoes not pass the write pointer WP. The reference image expansion unit254 then expands the compressed block having been read and outputs theexpanded block to the decoding unit 251. The decoding unit 251 generatesthe decoded image while referring to the block acquired from thereference image expansion unit 254 as the reference image. The outputimage selection unit 255 outputs the decoded image to the output unit240 as the output image.

There are cases where data transmission or reception is interrupted fora while due to fluctuation of a transmission band or the like. When thedecoding unit 251 continues decoding of the received frames in such astate, the reception memory 230 underflows. When the reception memory230 underflows, the expansion unit 250 halts operations of the decodingunit 251 and reference image storage 252 in addition to changingoperations of the reference image expansion unit 254 and output imageselection unit 255.

FIG. 11 illustrates the frame buffer 253 after occurrence of underflow.In FIG. 11, underflow has occurred in S2 and thus the write pointer WPstops halfway in a compressed block B2 of the frame F1. The referenceimage expansion unit 254 continues expanding the compressed blockwithout halting the operation even after the underflow occurrence. Theframe buffer 253 transits in the order of E3, E0, E1, E2, E3, etc.

When transited to the state E, the reference image expansion unit 254repeats reading blocks of one frame until underflow is canceled. Thatis, when the read pointer RP reaches the head of a block where the writepointer WP is stopped at, the reference image expansion unit 254 skipsthat block and reads a next block. In the example of FIG. 11, thereference image expansion unit 254 skips a compressed block F1B2 aftercompleting read of a compressed block F1B1 (state E0) and reads acompressed block F0B2 (state E1).

The output image selection unit 255 selects the reference image from thereference image expansion unit 254. The output image selection unit 255generates a composite image based on the selected reference image. Thecomposite image is a composition of a decoded part of the frame wheredecoding has been interrupted and, from among blocks in the precedingframe stored in the frame buffer 253, a block corresponding an undecodedpart. FIG. 12 is a composite image generated by the operation of E0 toE3 in FIG. 11. A composite image Fout in FIG. 12 includes blocks B0 andB1 of the frame F1 where decoding has been interrupted and blocks B2 andB3 of the preceding frame F0.

Read of the compressed block is repeated until the read pointer RPreaches the same position as that where underflow has occurred. Ifunderflow is canceled when the read pointer RP reaches the positionwhere the underflow has occurred, the expansion unit 250 restartsoperations of the decoding unit 251 and reference image storage 252.Thereafter, the expansion unit 250 transits from E2 to S2. If theunderflow has not been canceled, the expansion unit 250 continuesoperation of E3 to E2.

The decoding device 200 according to the embodiment includes the outputimage selection unit 255 in a subsequent stage to the decoding unit 251.The output image selection unit 255 selects, as the output image, areference image output from the reference image expansion unit 254 andnot the decoded image output from the decoding unit 251 when thereception memory 230 underflows. Therefore, even if a capacity of thebuffer in the preceding stage or subsequent stage to the decoding unit251 is small, the output image has little artifact. The decoding device200 allows for reducing the capacity of the buffer, thereby implementinglow power consumption, low delay, and low cost.

The decoding device 200 is configured to compress and store, in theframe buffer 253, the reference image. Therefore, the frame buffer 253with a capacity of around 500 K bytes can sufficiently store full highdefinition (FHD) data of one frame and one block. Since the capacity canbe reduced, the frame buffer 253 may be SRAM and not DRAM. Therefore,the decoding device 200 operates without a DRAM module, therebyimplementing low power consumption and low cost.

Moreover, the reference image storage 252 divides the decoded image in ahorizontal direction. As a result, an image output from the output imageselection unit 255 upon underflow occurrence may include differentframes in upper and lower segments. This image gives an impression to auser as if the image output stopped halfway of renewing the image fromthe top. Thus, the decoding device 200 allows the user to know withoutdiscomfort that reception of the image has stopped.

Second Embodiment

In H.264, encoding efficiency is enhanced by using a result of expandingthe preceding block upon encoding. Also in the present embodiment,encoding efficiency can be enhanced when a result of expanding apreceding block is used upon compression of a block by the referenceimage storage 252. However, the decoding device 200 of the firstembodiment controls the reference image storage 252 and reference imageexpansion unit 254 such that state transition upon underflow occurrenceis as illustrated in FIG. 11. This may result in a case where usage ofthe preceding block by the reference image storage 252 for encodingprevents the reference image expansion unit 254 from expanding acompressed block.

For example, the reference image expansion unit 254 expands a compressedblock in the order illustrated in FIG. 11 (E2, E3, E0, and E1). Thereference image expansion unit 254 is required to refer to a compressedblock F0B1 upon expanding a compressed block F0B2 (i.e. in E1). In E1,however, the compressed block F0B1 is not in the frame buffer 253.Therefore, in the example of FIG. 11, the reference image expansion unit254 cannot expand the compressed block F0B2. In the second embodiment,the reference image expansion unit 254 is made capable of expanding acompressed block even upon underflow occurrence.

An image transmission system 1 according to the second embodiment willbe described below. Note that configurations other than that of areference image expansion unit 254 are same and thus descriptionsthereon are omitted. FIG. 13 is a block diagram of the reference imageexpansion unit 254. The reference image expansion unit 254 includes animage expansion unit 254 a, a context storage 254 b, and a contextstoring memory 254 c.

The image expansion unit 254 a expands a compressed block in the framebuffer 253. The context storage 254 b stores a block expanded by theimage expansion unit 254 a to the context storing memory 254 c. Thecontext storing memory 254 c stores the block sent from the contextstorage 254 b. The context storage 254 b includes a readable andwritable storage device such as an SRAM. A capacity of the contextstorage 254 b is smaller than that of the frame buffer 253. For example,the capacity of the context storage 254 b may be for two blocks ofexpanded blocks.

Next, operation of the reference image expansion unit 254 will bedescribed. The context storage 254 b stores the block expanded by theimage expansion unit 254 a to the context storing memory 254 c whenthere is no underflow occurrence. When underflow occurs, the contextstorage 254 b sends the expanded block stored in the context storingmemory 254 c to the image expansion unit 254 a upon a request from theimage expansion unit 254 a. For example, when the image expansion unit254 a expands the compressed block F0B2 (E1 in FIG. 11), the contextstorage 254 b retrieves the expanded block F0B1 from the context storingmemory 254 c and sends the expanded block F0B1 to the image expansionunit 254 a. Thereafter, the image expansion unit 254 a refers to theexpanded block sent from the context storage 254 b and thereby expands acompressed block.

According to the present embodiment, the reference image expansion unit254 includes the context storage 254 b and context storing memory 254 ctherein. Therefore, the reference image expansion unit 254 can continueexpanding the compressed block even upon underflow occurrence. As aresult, the decoding device 200 can continue image output even uponunderflow occurrence while encoding efficiency of the reference image ismaintained.

Third Embodiment

The decoding device 200 according to the second embodiment is added withthe context storage 254 b, which may result in reduced throughput of thereference image expansion unit 254. For example, when the referenceimage expansion unit 254 recovers to a normal state after underflow iscanceled, the reference image expansion unit 254 may take time forcontext recovery processing. The context recovery processing isprocessing for returning to a normal state (a state without underflowoccurrence) and includes processing such as halting the context storage254 b or causing mode transitions to the image expansion unit 254 a.When the context recovery processing takes time, an output image fromthe decoding device 200 shows artificiality. In the third embodiment,even when the context recovery processing by the reference imageexpansion unit 254 takes time, the decoding device 200 is made capableof outputting an image without discomfort.

An image transmission system 1 according to the third embodiment will bedescribed below. Note that configurations other than that of anexpansion unit 250 are the same as those of the first embodiment andthus descriptions thereon are omitted. FIG. 14 is a block diagram of theexpansion unit 250. The expansion unit 250 includes a decoding unit 251,a reference image storage 252, a frame buffer 253, a reference imageexpansion unit 254, and an output image selection unit 255.

Configurations of the decoding unit 251, reference image storage 252,and frame buffer 253 are same as those of the first embodiment. Aconfiguration of the reference image expansion unit 254 is the same asthe one in FIG. 13. However, there is a difference that the referenceimage expansion unit 254 is capable of outputting a return signal to theoutput image selection unit 255. The return signal notifies the outputimage selection unit 255 that the context recovery processing has beencompleted.

The output image selection unit 255 has a configuration same as that ofthe output image selection unit 255 of the first embodiment. However,the output image selection unit 255 of the third embodiment switches anoutput image from the reference image to the decoded image whenunderflow is canceled and when receiving the return signal from thereference image expansion unit 254. The output image selection unit 255selects, as the output image, the reference image output from thereference image expansion unit 254 until receiving the return signaleven when underflow is canceled.

Note that an image output from the output image selection unit 255 isnot necessarily the reference image during execution of the contextrecovery processing, namely, a period after cancellation of underflow toreception of the return signal by the output image selection unit 255.For example, if the decoding unit 251 has a reference image buffertherein, the output image selection unit 255 may use an image stored inthe reference image buffer as an output image.

According to the present embodiment, even when the context recoveryprocessing takes time, the decoding device 200 can output an imagewithout giving discomfort to a user.

Fourth Embodiment

Most of data to be stored in the context storage 254 b is pixelinformation. Data other than the pixel information (e.g. control data)is small in quantity compared to the pixel information. If the decodingunit 251 has a reference image buffer therein, the pixel informationremains in the reference image buffer. Leveraging this allows forreducing a capacity of the context storing memory 254 c. In the fourthembodiment, a capacity of the context storing memory 254 c is reduced byusing data in the reference image buffer.

An image transmission system 1 according to the fourth embodiment willbe described below. Note that configurations other than that of anexpansion unit 250 are the same as those of the first embodiment andthus descriptions thereon are omitted. FIG. 15 is a block diagram of theexpansion unit 250. The expansion unit 250 includes a decoding unit 251,a reference image storage 252, a frame buffer 253, a reference imageexpansion unit 254, and an output image selection unit 255.

The decoding unit 251 of the fourth embodiment includes a referenceimage buffer 251 a. A block expanded by the reference image expansionunit 254 is once stored in the reference image buffer 251 a.

Although a configuration of the reference image expansion unit 254 isthe same as that of the third embodiment, the context storage 254 b canacquire data not only from the context storing memory 254 c but alsofrom the reference image buffer 251 a. Other configurations are the sameas those of the expansion unit 250 of the third embodiment.

Operation of the reference image expansion unit 254 will be described.When underflow occurs, the context storage 254 b sends the pixelinformation stored in the reference image buffer 251 a to the imageexpansion unit 254 a upon a request from the image expansion unit 254 a.The context storage 254 b sends the data other than the pixelinformation stored in the context storing memory 254 c to the imageexpansion unit 254 a. Thereafter, the image expansion unit 254 a expandsthe compressed block using the data sent from the context storage 254 b.

According to the present embodiment, a capacity of the context storingmemory 254 c can be reduced since the context storage 254 b isconfigured to allow for acquisition of pixel information from thereference image buffer 251 a in the decoding unit 251.

Note that, when employing the configuration of the fourth embodiment,reading for context recovery processing by the context storage 254 b andreading for decoded image output by the decoding unit 251 upon contextrecovery processing may concurrently occur in the reference image buffer251 a. Occurrence of concurrent reading lowers throughput of thereference image expansion unit 254. However, if the reference imagebuffer 251 a includes an SRAM having a plurality of banks, the contextstorage 254 b is only required to read, for context recovery, from abank where no reading for decoded image output is performed. This allowsfor avoiding competing reading from the SRAM, thereby enhancingthroughput of the decoding unit 251 and reference image expansion unit254.

Note that the present embodiment is one example and thus variousmodifications or applications may be applied. For example, the expansionunit 250 may be configured such that the decoding unit 251, referenceimage storage 252, reference image expansion unit 254, and output imageselection unit 255 operate in a pipeline manner. In this case, thereference image storage 252 selects a leading compressed block inconsideration of a pipeline delay upon underflow occurrence.

While the capacity of the frame buffer 253 is one frame and one block inthe present embodiment, the capacity of the frame buffer 253 may belarger than that for one frame and one block. Output of one frame isrepeated from a starting point of the read pointer RP. That is, whenread of one frame is completed, reading is repeated from the startingpoint while skipping a remaining block.

While the reference image storage 252 divides the decoded image intofour processing blocks in the present embodiment, the number of blocksper image is not limited to four. The number of blocks per image may besmaller or greater than four. Note that the capacity of the frame buffer253 has to be at least for one frame and one block in order to implementthe decoding device 200 of the present embodiment. Increasing the numberof blocks per image reduces a capacity required for one block, therebyreducing the capacity of the frame buffer 253.

Furthermore, in the present embodiment, the output image selection unit255 acquires a block of a previous frame stored in the frame buffer 253via the reference image expansion unit 254. However, a part of expansionresult of the reference image is retained in the inner buffer in thedecoding unit 251 upon underflow occurrence. For example, the part ofexpansion result is retained in the inner buffer in the decoding unit251 for retaining pixels within a searching range of motion search.Therefore, the output image selection unit 255 may be allowed to acquirethe block from this inner buffer. In this case, a total capacity of boththe frame buffer 253 and the inner buffer in the decoding unit 251 isonly required to accommodate one frame and a block. Therefore, thecapacity of the frame buffer 253 may be reduced.

Moreover, in the present embodiment, the reference image storage 252stores the processing block in the frame buffer 253 in a compressedformat. However, the reference image storage 252 is not necessarilyrequired to store the processing block in the frame buffer 253 in acompressed format. In this case, the decoding unit 251 and the outputimage selection unit 255 acquire the processing block directly from theframe buffer 253.

Note that the decoding device 200 may be a complete product such as aTV, player, recorder, personal computer, fixed telephone set, portabletelephone set, smartphone, tablet terminal, personal digital assistant(PDA), or a gaming machine. Alternatively, the decoding device 200 maybe a component such as a semiconductor chip or semiconductor substrate.

The encoding device 100 and the decoding device 200 according to thepresent embodiment may be implemented by a dedicated computer system orby a normal computer system. For example, the encoding device 100 andthe decoding device 200 may be configured by storing a program forexecuting the aforementioned operation in a computer-readable storagemedium such as an optical disc, semiconductor memory, magnetic tape, orflexible disc for distribution and allowing a computer to install theprogram for execution of the aforementioned processing thereon.Alternatively, the program may be stored in a disc device included in aserver device on a network such as the Internet to allow a computer todownload, etc. the program therefrom. Alternatively, the aforementionedfunction may be implemented by cooperation between an operating system(OS) and an application software. In this case, a part other than thatin the OS may be stored in a medium for distribution or stored in aserver device to allow a computer to download, etc. therefrom.

The embodiments according to the present invention have been describedabove, but the embodiments are demonstrated by way of example and do notintend to limit the scope of the invention. The novel embodiments may beaccomplished in various forms and may be variously omitted, replaced andchanged without departing from the scope of the invention. Theembodiments and their variants are encompassed in the scope or spirit ofthe invention, and are encompassed in the invention described in Claimsand the range of its equivalents.

What is claimed is:
 1. A decoding device comprising: a reception memoryconfigured to store received image; a frame buffer configured to store areference image; a decoding unit configured to decode the received imagebased on the reference image and to generate a decoded image; areference image storage configured to store the decoded image in theframe buffer as the reference image; and an output image selection unitconfigured to select the reference image stored in the frame buffer whenthe reception memory underflows and to select the decoded image when thereception memory does not underflow.
 2. The decoding device according toclaim 1, wherein the reference image stored in the frame buffer is thecompressed reference image where the decoded image is compressed, thedecoding device further comprising a reference image expansion unitconfigured to output the reference image having been expanded from thecompressed reference image to the decoding unit and the output imageselection unit.
 3. The decoding device according to claim 2, wherein thereference image storage compresses the decoded image by each block, andthe output image selection unit outputs a composite image formed by adecoded part of the received image and the reference image,corresponding to an undecoded part, stored in the frame buffer whendecoding by the decoding unit is interrupted halfway in a frame due tothe underflow.
 4. The decoding device according to claim 3, wherein theoutput image selection unit repeats outputting the composite image untilthe underflow is canceled.
 5. The decoding device according to claim 3,wherein the reference image storage stores the decoded image dividedinto a plurality of blocks in the frame buffer.
 6. The decoding deviceaccording to claim 3, wherein a capacity of the frame buffer is smallerthan a capacity for two frames of the compressed reference image.
 7. Thedecoding device according to claim 3, wherein the frame buffer is anSRAM.
 8. The decoding device according to claim 1, wherein the referenceimage storage stores the decoded image in the frame buffer by eachblock, and the output image selection unit outputs a composite imagewhere an undecoded part of a frame output from the decoding unit isinterpolated from the block stored in the frame buffer when decoding bythe decoding unit is interrupted halfway in the frame.
 9. The decodingdevice according to claim 1, wherein the reference image storage storesthe decoded image, compressed by each block, in the frame buffer, andthe output image selection unit outputs a composite image formed by adecoded part of a frame where decoding has been interrupted and, fromamong the blocks in a preceding frame stored in the frame buffer, theblock corresponding an undecoded part when decoding by the decoding unitis interrupted halfway in the frame.
 10. An image transmission systemcomprising an encoding device configured to compress and to transmit animage signal and a decoding device configured to expand the image signalreceived from the encoding device, wherein the decoding devicecomprises: a reception memory configured to store the image signal; afirst frame buffer configured to store a first reference image; adecoding unit configured to decode the image signal based on the firstreference image and to generate a decoded image; a first reference imagestorage configured to store the decoded image in the first frame bufferas the first reference image; and an output image selection unitconfigured to select the first reference image stored in the first framebuffer when the reception memory underflows and to select the decodedimage when the reception memory does not underflow.
 11. The imagetransmission system according to claim 10, wherein the encoding devicecomprises: a second frame buffer configured to store a second referenceimage; an encoding unit configured to generate an image where the imagesignal is encoded based on the second reference image stored in thesecond frame buffer; and a second reference image storage configured togenerate a local decoded image by decoding the image having been encodedand to store the local decoded image in the second frame buffer as thesecond reference image.
 12. The image transmission system according toclaim 11, wherein the first reference image stored in the first framebuffer is the compressed reference image where the decoded image iscompressed, and the first reference image storage stores the compressedreference image, compressed by a same method as that of the secondreference image storage, in the first frame buffer.
 13. The imagetransmission system according to claim 12, further comprising a firstreference image expansion unit configured to output the first referenceimage, expanded from the compressed reference image, to the decodingunit and the output image selection unit.
 14. The image transmissionsystem according to claim 13, wherein the first reference image storagecompresses the decoded image by each block, and the output imageselection unit outputs a composite image formed by a decoded part of theimage signal and the first reference image, corresponding to anundecoded part, stored in the first frame buffer when decoding by thedecoding unit is interrupted halfway in a frame due to the underflow.15. The image transmission system according to claim 14, wherein theoutput image selection unit repeats outputting the composite image untilthe underflow is canceled.
 16. The image transmission system accordingto claim 14, wherein the first reference image storage stores thedecoded image divided into a plurality of blocks in the first framebuffer.
 17. The image transmission system according to claim 10, whereinthe first reference image storage stores the decoded image by each blockin the frame buffer, and the output image selection unit outputs acomposite image where an undecoded part of a frame, output from thedecoding unit, is interpolated from the block stored in the frame bufferwhen decoding by the decoding unit is interrupted halfway in the frame.18. The image transmission system according to claim 10, wherein thefirst reference image storage stores the decoded image, compressed byeach block, in the first frame buffer, and the output image selectionunit outputs a composite image formed by a decoded part of a frame wheredecoding has been interrupted and, from among the blocks in a precedingframe stored in the first frame buffer, the block corresponding anundecoded part when decoding by the decoding unit is interrupted halfwayin the frame.
 19. The image transmission system according to claim 11,wherein the image signal compressed by the encoding unit is stream data,and the encoding unit halts encoding of the image signal when the imagesignal cannot be transmitted to the decoding device, and when the imagesignal can be transmitted thereafter, encodes a present frame using aframe, where encoding has been halted, as the second reference image.20. A decoding method comprising: decoding image acquired via areception memory based on a reference image stored in a frame buffer;storing a decoded image, obtained by decoding, in the frame buffer asthe reference image; and selecting the reference image stored in theframe buffer as an output image when the reception memory underflows andselecting the decoded image as the output image when the receptionmemory does not underflow.